@use "sass:color";
@use "vars.scss";

html {
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: default;
  -webkit-user-select: none;
  font-family: vars.$nuclear-font;
}

@keyframes body-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

body {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  animation: body-fade-in vars.$long-duration;
}

body.dimmed {
  #react-root {
    height: 100%;
  }
}

a {
  text-decoration: none;
  color: vars.$white;

  &:hover {
    text-decoration: none;
    color: vars.$white;
    transition: vars.$short-duration;
  }
}

a.disabled {
  color: rgba(vars.$grey, 0.25);
  cursor: default;

  &:hover,
  &:focus,
  &:active {
    background-color: vars.$background2 !important;
    color: rgba(vars.$grey, 0.25);
  }
}

button.ui.button {
  & + & {
    margin-left: 0.5rem;
  }
}

input {
  &::selection {
    background: rgba(vars.$lightbg, 0.85);
    color: vars.$white;
  }
}

table {
  border-collapse: collapse;
}

::-webkit-scrollbar {
  width: 0.5rem !important;
  height: 0.5rem !important;
}

::-webkit-scrollbar-track {
  background-color: vars.$background !important;
  border-radius: 0.55rem !important;
}

::-webkit-scrollbar-thumb {
  border-radius: 0.5rem !important;
  background-color: vars.$background2 !important;
  transition: vars.$short-duration;
}

::-webkit-scrollbar-corner {
  background-color: transparent !important;
}

//Semantic UI section
.ui.segment {
  color: vars.$white;
  background: vars.$background3;
  position: relative;
}

.ui.inverted.segment {
  background: vars.$background3;
}

.ui.menu,
.ui.vertical.menu {
  background: vars.$background3;

  .item {
    color: vars.$white;
  }
}

.ui.secondary.pointing.menu {
  border-color: rgba(vars.$white, 0.15);

  a.item {
    &:hover {
      color: vars.$white;
    }

    font-variant: all-small-caps;
    font-size: 20px;
  }

  .active.item {
    color: vars.$white;
    border-color: vars.$green;

    &:hover {
      color: vars.$white;
      border-color: vars.$green;
    }
  }
}

.ui.dimmer.visible {
  z-index: 2000;
}

.ui.tab.loading.segment,
.ui.tab.loading,
.ui.loader,
.ui.dimmer .ui.loader {
  &:before {
    background: rgba(vars.$background2, 0.2);
    border: 0.2em solid rgba(vars.$background2, 0.6);
  }

  &:after {
    border-color: vars.$green transparent transparent;
  }
}

.ui.modals.dimmer {
  background: rgba(vars.$black, 0.85);

  .content {
    height: auto;
  }
}

.ui.modal.transition {
  height: auto;
}

.ui.button {
  transition: vars.$short-duration;
}

.ui.primary.button {
  background-color: vars.$blue;

  &:hover,
  &:focus {
    background-color: color.adjust(vars.$blue, $lightness: -10%);
  }

  &:active {
    background-color: color.adjust(vars.$blue, $lightness: -20%);
  }
}

.ui.inverted.button {
  box-shadow: 0 0 0 1px vars.$grey inset !important;
}

.ui.inverted.green.button {
  border-color: vars.$green;
  color: vars.$green;

  &:hover,
  &:focus {
    background-color: vars.$green;
  }
}

.ui.inverted.red.basic.button:focus {
  color: vars.$red !important;

  &:hover,
  &:focus {
    background-color: vars.$red;
  }
}

.ui.checkbox {
  .box::before,
  label::before {
    background-color: rgba(vars.$background3, 0.35) !important;
    transition: vars.$medium-duration;
  }

  .box:hover::before,
  label:hover::before {
    background-color: rgba(vars.$background2, 0.25) !important;
    transition: vars.$medium-duration;
  }
}

.ui.toggle.checkbox {
  input:focus:checked ~ .box:before,
  input:focus:checked ~ label:before,
  input:checked ~ .box:before,
  input:checked ~ label:before {
    background-color: vars.$blue !important;
    transition: vars.$medium-duration;
  }
}

.ui.red.button,
.ui.red.button:hover,
.ui.red.button:focus,
.ui.red.button:active {
  background-color: vars.$red;
}

.ui.dropdown {
  .menu {
    background: vars.$bgdarker;
    border: 1px solid rgba(vars.$bgdefault, 0.6);
    box-shadow: 0rem 0.125rem 0.5rem 0.25rem rgba(vars.$black, 0.1);

    .header,
    .item,
    .item:hover {
      color: vars.$white;
    }

    .item:hover {
      background: vars.$bgdefault;
    }
  }
}

hr {
  border: 1px solid vars.$bgdefault;
}

.item.fade.visible.transition {
  display: flex;
  width: 100%;
  height: 60px;
  flex: 0 0 auto;
  margin: 0.5rem;
}

.ui.inverted.list .item a:not(.ui) {
  color: vars.$white !important;

  &:hover,
  &:focus,
  &:active {
    color: vars.$white !important;
  }
}

.link_button {
  display: flex;
  justify-content: center;
  align-items: center;
  background: vars.$background2;
  color: vars.$white !important;
  width: 2rem;
  height: 2rem;

  &:hover {
    background: color.adjust(vars.$background2, $lightness: 10%);
    color: vars.$white !important;
  }

  &:active {
    background: color.adjust(vars.$background2, $lightness: 20%);
    color: vars.$white !important;
  }
}

i.red.icon {
  color: vars.$red !important;
}
